function [L] = lss(i,j,nx)
L = i+(j-1)*(nx-1);